package scau.erps.test;

import java.awt.EventQueue;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import java.awt.BorderLayout;

public class ManagementFrame {

	private JFrame frame;
	private JPanel bankPane,bankScreenPane,bankDataPane,customerPane,supplierPane,equipmentPane,teacherPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					ManagementFrame window = new ManagementFrame();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public ManagementFrame() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(10, 10, 1024, 768);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.add(getBankPane(),"银行");
		tabbedPane.add(getCustomerPane(),"客户");
		tabbedPane.add(getSupplierPane(),"供应商");
		tabbedPane.add(getEquipmentPane(),"设备商");
		tabbedPane.add(getTeacherPane(),"教师");
		frame.getContentPane().add(tabbedPane, BorderLayout.CENTER);		
	}
	private JPanel getBankPane(){
		bankPane = new JPanel();
		bankPane.setLayout(new BorderLayout());
		bankPane.add(getBankScreenPane(),BorderLayout.NORTH);
		bankPane.add(getBankDataPane(),BorderLayout.CENTER);
		bankPane.add(new JLabel("共有数据 120条"),BorderLayout.SOUTH);	
		return bankPane;
	}
	public JPanel getBankScreenPane(){
		bankScreenPane = new JPanel();
		bankScreenPane.setLayout(new GridLayout(1,5,10,5));	
		JComboBox jComboBox1=new JComboBox(new String[]{"所有","小组1","小组2"});
		JComboBox jComboBox2=new JComboBox(new String[]{"短贷","长贷","高利贷"});	
		JComboBox jComboBox3=new JComboBox(new String[]{"已审批","未审批"});	
		JComboBox jComboBox4=new JComboBox(new String[]{"未还款","已超期","已还款"});
		JButton btn = new JButton("筛选");
		bankScreenPane.add(jComboBox1);
		bankScreenPane.add(jComboBox2);
		bankScreenPane.add(jComboBox3);
		bankScreenPane.add(jComboBox4);
		bankScreenPane.add(btn);
		return bankScreenPane;
	}
	public JPanel getBankDataPane(){
		bankDataPane = new JPanel();
		JLabel label1 = new JLabel("数据列表");
		bankDataPane.add(label1);
		return bankDataPane;
	}
	
	private JPanel getCustomerPane(){
		customerPane = new JPanel();
		return customerPane;
	}
	private JPanel getSupplierPane(){
		supplierPane = new JPanel();
		return supplierPane;
	}
	private JPanel getEquipmentPane(){
		equipmentPane = new JPanel();
		return equipmentPane;
	}
	private JPanel getTeacherPane(){
		teacherPane = new JPanel();
		return teacherPane;
	}
	

}
